import { useContext } from 'react'; 
import CounterContext1 from './context.js';
let EChild1 = (props, ref)=>{
	console.log('EChild1', 'render');
	const { count1, setCount1, count2, setCount2 } = useContext(CounterContext1);
	const handleClick1 = () => {
		console.log('EChild1', 'handleClick1');
		setCount1(count1 + 1);
	}
	const handleClick2 = () => {
		console.log('EChild1', 'handleClick2');
		setCount2(count2 + 1);
	}
	return (
		<div>
			<div onClick={handleClick1}>EChild1:点击触发子组件事件1:count1:{count1}</div>
			<div onClick={handleClick2}>EChild1:点击触发子组件事件2:count2:{count2}</div>
		</div>
	);
};

export default EChild1 